Shader "ShaderPractice/ComputerScreenPos1"{
    SubShader{
        Pass{
            CGPROGRAM

            #pragma vertex vert
            #pragma fragment frag
            #include "UnityCG.cginc"

            float4 vert(float4 v: POSITION): SV_POSITION {
                return UnityObjectToClipPos(v);
            }

            // VPOS/WPOS 是屏幕坐标的语义
            // _ScreenParams.xy 是屏幕分辨率
            float4 frag(float4 p: VPOS): SV_TARGET {
                return fixed4(p.xy / _ScreenParams.xy , 0.0, 1.0);
            }
            
            ENDCG
        }    
    }
}


